<!DOCTYPE html>
<html lang="en">
<head>
    
    <meta charset="utf-8">
    <title>Field - Aliwork helper</title>
    
    <meta name="description" content="宜搭前端 JS 工具代码库" />
    
        <meta name="keywords" content="Aliwork 宜搭 工具库" />
        <meta name="keyword" content="Aliwork 宜搭 工具库" />
    
    
    
    <script src="scripts/prettify/prettify.js"></script>
    <script src="scripts/prettify/lang-css.js"></script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
    <script src="scripts/nav.js" defer></script>
    
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
  <div class="navicon"></div>
</label>

<label for="nav-trigger" class="overlay"></label>

<nav >
    
    <input type="text" id="nav-search" placeholder="Search" />
    
    
    <h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/hackingzhang/aliwork-helper" target="_blank" class="menu-item" >Github</a></h2><h2><a href="https://gitee.com/hexzhangshuai/aliwork-helper" target="_blank" class="menu-item" >Gitee码云</a></h2><h2><a href="https://docs.aliwork.com/docs/developer/api/about" target="_blank" class="menu-item" >宜搭开放API</a></h2><h3>Modules</h3><ul><li><a href="module-DataLinkage.html">DataLinkage</a><ul class='methods'><li data-type='method'><a href="module-DataLinkage.html#.dataLinkage">dataLinkage</a></li><li data-type='method'><a href="module-DataLinkage.html#.dataLinkageSubform">dataLinkageSubform</a></li><li data-type='method'><a href="module-DataLinkage.html#~resolveConditionMap">resolveConditionMap</a></li></ul></li><li><a href="module-DataSource.html">DataSource</a><ul class='methods'><li data-type='method'><a href="module-DataSource.html#.deleteFormData">deleteFormData</a></li><li data-type='method'><a href="module-DataSource.html#.executeTask">executeTask</a></li><li data-type='method'><a href="module-DataSource.html#.fetchSubformDatas">fetchSubformDatas</a></li><li data-type='method'><a href="module-DataSource.html#.fetchSubformDatasAll">fetchSubformDatasAll</a></li><li data-type='method'><a href="module-DataSource.html#.getFormData">getFormData</a></li><li data-type='method'><a href="module-DataSource.html#.getOperationRecords">getOperationRecords</a></li><li data-type='method'><a href="module-DataSource.html#.saveFormData">saveFormData</a></li><li data-type='method'><a href="module-DataSource.html#.searchFormDataIds">searchFormDataIds</a></li><li data-type='method'><a href="module-DataSource.html#.searchFormDataIdsAll">searchFormDataIdsAll</a></li><li data-type='method'><a href="module-DataSource.html#.searchFormDatas">searchFormDatas</a></li><li data-type='method'><a href="module-DataSource.html#.searchFormDatasAll">searchFormDatasAll</a></li><li data-type='method'><a href="module-DataSource.html#.startInstance">startInstance</a></li><li data-type='method'><a href="module-DataSource.html#.updateFormData">updateFormData</a></li></ul></li><li><a href="module-Field.html">Field</a><ul class='methods'><li data-type='method'><a href="module-Field.html#.activateTabItems">activateTabItems</a></li><li data-type='method'><a href="module-Field.html#.fieldToString">fieldToString</a></li><li data-type='method'><a href="module-Field.html#.fieldValueDiff">fieldValueDiff</a></li><li data-type='method'><a href="module-Field.html#.fieldValueEqualSingle">fieldValueEqualSingle</a></li><li data-type='method'><a href="module-Field.html#.generateAssociationFormFieldData">generateAssociationFormFieldData</a></li><li data-type='method'><a href="module-Field.html#.generateDptFieldData">generateDptFieldData</a></li><li data-type='method'><a href="module-Field.html#.generateEmployeeFieldData">generateEmployeeFieldData</a></li><li data-type='method'><a href="module-Field.html#.getFieldDataTypeById">getFieldDataTypeById</a></li><li data-type='method'><a href="module-Field.html#.getFieldTypeById">getFieldTypeById</a></li><li data-type='method'><a href="module-Field.html#.mergeTo">mergeTo</a></li><li data-type='method'><a href="module-Field.html#.syncTo">syncTo</a></li></ul></li><li><a href="module-Subform.html">Subform</a><ul class='methods'><li data-type='method'><a href="module-Subform.html#.associateForm2Subform">associateForm2Subform</a></li><li data-type='method'><a href="module-Subform.html#.sum2Main">sum2Main</a></li><li data-type='method'><a href="module-Subform.html#~resolveFieldMaps">resolveFieldMaps</a></li></ul></li><li><a href="module-UI.html">UI</a><ul class='methods'><li data-type='method'><a href="module-UI.html#.dialog">dialog</a></li><li data-type='method'><a href="module-UI.html#.hijackSubmit">hijackSubmit</a></li><li data-type='method'><a href="module-UI.html#.loading">loading</a></li></ul></li><li><a href="module-Utils.html">Utils</a><ul class='methods'><li data-type='method'><a href="module-Utils.html#.dateTimeFormat">dateTimeFormat</a></li><li data-type='method'><a href="module-Utils.html#.generateRandomId">generateRandomId</a></li><li data-type='method'><a href="module-Utils.html#.isEmpty">isEmpty</a></li><li data-type='method'><a href="module-Utils.html#.retry">retry</a></li><li data-type='method'><a href="module-Utils.html#.round">round</a></li><li data-type='method'><a href="module-Utils.html#.sleep">sleep</a></li></ul></li></ul><h3>Classes</h3><ul><li><a href="FieldChangeLogger.html">FieldChangeLogger</a><ul class='methods'><li data-type='method'><a href="FieldChangeLogger.html#change">change</a></li><li data-type='method'><a href="FieldChangeLogger.html#clear">clear</a></li><li data-type='method'><a href="FieldChangeLogger.html#format">format</a></li></ul></li><li><a href="module-Subform-Subform.html">Subform</a><ul class='methods'><li data-type='method'><a href="module-Subform-Subform.html#getDatas">getDatas</a></li><li data-type='method'><a href="module-Subform-Subform.html#getFormGroupId">getFormGroupId</a></li><li data-type='method'><a href="module-Subform-Subform.html#getFormGroupIds">getFormGroupIds</a></li><li data-type='method'><a href="module-Subform-Subform.html#getIndex">getIndex</a></li><li data-type='method'><a href="module-Subform-Subform.html#getInstance">getInstance</a></li><li data-type='method'><a href="module-Subform-Subform.html#getItem">getItem</a></li><li data-type='method'><a href="module-Subform-Subform.html#setDatas">setDatas</a></li><li data-type='method'><a href="module-Subform-Subform.html#summary">summary</a></li><li data-type='method'><a href="module-Subform-Subform.html#updateItem">updateItem</a></li></ul></li></ul>
    
</nav>

<div id="main">
    
    <h1 class="page-title">Field</h1>
    

    




<section>

<header>
    
</header>

<article>
    
        <div class="container-overview">
        
            

<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>表单/自定义页面字段相关方法</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line1">line 1</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>




            
                <div class="description usertext">表单/自定义页面字段相关方法</div>
            

            
        
        </div>
    

    

    

    
    
    

     

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    <h4 class="name" id=".activateTabItems"><span class="type-signature type-signature-static">(static) </span>activateTabItems<span class="signature">(context, tabFieldId)</span><span class="type-signature"></span></h4>

    




<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>激活Tab组件中所有Tab项，此方法用于解决在表单上使用Tab组件时嵌套在Tab内的组件会报错，
且无法通过JS API获取组件实例。<br />
一般在 didMount 中调用此函数即可。</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line21">line 21</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>











    <h5 class="h5-examples">Example</h5>
    
    <pre class="prettyprint"><code>export function didMount() {
  activateTabItems(this, "tabsLayout_lhzy2spv");
}</code></pre>




    <h5 class="h5-parameters">Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>context</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>



            
            </td>

            

            

            <td class="description last">this上下文</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>tabFieldId</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">TAB组件唯一标识符</td>
        </tr>

    
    </tbody>
</table>



















        
            

    

    <h4 class="name" id=".fieldToString"><span class="type-signature type-signature-static">(static) </span>fieldToString<span class="signature">(value, fieldType)</span><span class="type-signature"> &rarr; {string}</span></h4>

    




<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>字段值转换为易读的字符串</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line413">line 413</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>











    <h5 class="h5-examples">Example</h5>
    
    <pre class="prettyprint"><code>// 日期字段
const date = this.$("dateField_lrh5sl2w").getValue(); // 1704067200000
fieldToString(date, getFieldTypeById("dateField_lrh5sl2w")); // "2024-01-01"

// 人员字段
const employee = this.$("dateField_lrh5sl2w").getValue(); // [{ name: "张三", value: "1343242225778381" }, { name: "李四", value: "1343242225778382" }]
fieldToString(date, getFieldTypeById("employeeField_lrh6iy5m")); // "[张三,李四]"</code></pre>




    <h5 class="h5-parameters">Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>value</code></td>
            

            <td class="type">
            
                
<span class="param-type">any</span>



            
            </td>

            

            

            <td class="description last">字段值</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>fieldType</code></td>
            

            <td class="type">
            
                
<span class="param-type">FieldType</span>



            
            </td>

            

            

            <td class="description last">字段类型</td>
        </tr>

    
    </tbody>
</table>
















<h5 class="h5-returns">Returns:</h5>

        
<div class="param-desc">
    字符串
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">string</span>



    </dd>
</dl>

    



        
            

    

    <h4 class="name" id=".fieldValueDiff"><span class="type-signature type-signature-static">(static) </span>fieldValueDiff<span class="signature">(fieldType, newVal, oldVal)</span><span class="type-signature"> &rarr; {<a href="module-Field.html#~FieldValueDiff">module:Field~FieldValueDiff</a>}</span></h4>

    




<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>两个相同类型的字段值的差异</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line358">line 358</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>











    <h5 class="h5-examples">Example</h5>
    
    <pre class="prettyprint"><code>// [{ name: "张三", value: "1343242225778381" }, { name: "李四", value: "1343242225778382" }]
const employeeA = this.$("employeeField_lrh5sl2v").getValue();
// [{ name: "张三", value: "1343242225778381" }, { name: "王二", value: "1298349283929102" }]
const employeeB = this.$("employeeField_lrhbdj3c").getValue();
const fieldType = getFieldTypeById("employeeField_lrh5sl2v"); // employee
fieldValueDiff(fieldType, employeeA, employeeB);
// {
//   isEqual: false, new: [{ name: "张三", value: "1343242225778381" }, { name: "李四", value: "1343242225778382" }],
//   old: [{ name: "张三", value: "1343242225778381" }, { name: "王二", value: "1298349283929102" }],
//   diff: {
//     added: [{ name: "李四", value: "1343242225778382" }],
//     removed: [{ name: "王二", value: "1298349283929102" }]
//   }
// }</code></pre>




    <h5 class="h5-parameters">Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>fieldType</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">字段类型，可通过getFieldTypeById获取</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>newVal</code></td>
            

            <td class="type">
            
                
<span class="param-type">any</span>



            
            </td>

            

            

            <td class="description last">新字段值</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>oldVal</code></td>
            

            <td class="type">
            
                
<span class="param-type">any</span>



            
            </td>

            

            

            <td class="description last">旧字段值</td>
        </tr>

    
    </tbody>
</table>
















<h5 class="h5-returns">Returns:</h5>

        
<div class="param-desc">
    描述两个值的差异对象
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-Field.html#~FieldValueDiff">module:Field~FieldValueDiff</a></span>



    </dd>
</dl>

    



        
            

    

    <h4 class="name" id=".fieldValueEqualSingle"><span class="type-signature type-signature-static">(static) </span>fieldValueEqualSingle<span class="signature">(fieldType, valA, valB)</span><span class="type-signature"> &rarr; {boolean}</span></h4>

    




<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>判断两个字段单值是否相等，如果字段数据类型为数组，需要传入单个数组元素</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line277">line 277</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>











    <h5 class="h5-examples">Example</h5>
    
    <pre class="prettyprint"><code>const employeeA = this.$("employeeField_lrh5sl2v").getValue();
const employeeB = this.$("employeeField_lrhbdj3c").getValue();
const fieldType = getFieldTypeById("employeeField_lrh5sl2v"); // employee
fieldValueEqualSingle(fieldType, employeeA[0], employeeB[0]); // true or false</code></pre>




    <h5 class="h5-parameters">Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>fieldType</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">字段类型，可通过<code>getFieldTypeById</code>获取</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>valA</code></td>
            

            <td class="type">
            
                
<span class="param-type">any</span>



            
            </td>

            

            

            <td class="description last">字段值A</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>valB</code></td>
            

            <td class="type">
            
                
<span class="param-type">any</span>



            
            </td>

            

            

            <td class="description last">字段值B</td>
        </tr>

    
    </tbody>
</table>
















<h5 class="h5-returns">Returns:</h5>

        
<div class="param-desc">
    两个值是否相等
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>



    </dd>
</dl>

    



        
            

    

    <h4 class="name" id=".generateAssociationFormFieldData"><span class="type-signature type-signature-static">(static) </span>generateAssociationFormFieldData<span class="signature">(appType, formUuid, formType, instances)</span><span class="type-signature"></span></h4>

    




<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>生成关联表单字段数据，可直接赋值给关联表单组件</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line245">line 245</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>











    <h5 class="h5-examples">Example</h5>
    
    <pre class="prettyprint"><code>const associationForm = generateAssociationFormFieldData(
   "APP_xxxxxx",
   "FORM-xxxxxx",
   "receipt",
   [{ isntanceId: "FINST-xxxxxx", title: "标题", subTitle: "副标题" }]
);

this.$("associationFormField_lrh5sl2u").setValue(associationForm);</code></pre>




    <h5 class="h5-parameters">Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>appType</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">应用ID</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>formUuid</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">表单ID</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>formType</code></td>
            

            <td class="type">
            
                
<span class="param-type">"receipt"</span>
|

<span class="param-type">"process"</span>



            
            </td>

            

            

            <td class="description last">单据类型，receipt-表单，process-流程</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>instances</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;AssociationFormInstance></span>



            
            </td>

            

            

            <td class="description last">关联表单实例信息数组</td>
        </tr>

    
    </tbody>
</table>



















        
            

    

    <h4 class="name" id=".generateDptFieldData"><span class="type-signature type-signature-static">(static) </span>generateDptFieldData<span class="signature">(id, name)</span><span class="type-signature"> &rarr; {object}</span></h4>

    




<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>生成部门字段数据，可直接赋值给部门组件<br/ >
⚠️如果传数组作为参数，ID和名称的顺序必须一一对应。<br />
🤯通过数据源获取到的表单数据，部门字段的值就是部门ID和部门名称分开的两个数组，
可以直接将其传入来生成可赋值给部门组件的部门字段数据。</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line138">line 138</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>











    <h5 class="h5-examples">Example</h5>
    
    <pre class="prettyprint"><code>const dpt = generateDptFieldData("047126", "财务部");
const dpt = generateDptFieldData(["047126", "048374"], ["财务部", "人事部"]);

// 结合数据源使用
getFormData(this, "form", "FINST-xxxxxx").then(formData => {
  const ids = formData.departmentSelectField_lbbyyrcy_id;
  const names = formData.departmentSelectField_lbbyyrcy;

  const dpt = generateDptFieldData(ids, names);

  this.$("departmentSelectField_lbbxxrcz").setValue(dpt);
});</code></pre>




    <h5 class="h5-parameters">Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Array.&lt;string></span>



            
            </td>

            

            

            <td class="description last">部门ID，接受单个ID字符串或者ID数组</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>name</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Array.&lt;string></span>



            
            </td>

            

            

            <td class="description last">部门名称，接受单个名称字符串或者名称数组</td>
        </tr>

    
    </tbody>
</table>
















<h5 class="h5-returns">Returns:</h5>

        
<div class="param-desc">
    部门字段数据
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">object</span>



    </dd>
</dl>

    



        
            

    

    <h4 class="name" id=".generateEmployeeFieldData"><span class="type-signature type-signature-static">(static) </span>generateEmployeeFieldData<span class="signature">(id, name)</span><span class="type-signature"> &rarr; {object|Array.&lt;object>}</span></h4>

    




<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>生成员工字段数据，可直接赋值给员工组件
⚠️如果传数组作为参数，ID和姓名的顺序必须一一对应。<br />
🤯通过数据源获取到的表单数据，员工字段的值就是员工ID和员工姓名分开的两个数组，
可以直接将其传入来生成可赋值给员工组件的员工字段数据。</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line180">line 180</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>











    <h5 class="h5-examples">Example</h5>
    
    <pre class="prettyprint"><code>const employee = generateEmployeeFieldData("1343242225778381", "张三");
const employee = generateEmployeeFieldData(["1343242225778381", "1343242225778382"], ["张三", "李四"]);

// 结合数据源使用
getFormData(this, "form", "FINST-xxxxxx").then(formData => {
  const ids = formData.employeeField_lm1cl4dk_id;
  const names = formData.employeeField_lm1cl4dk;

  const employee = generateEmployeeFieldData(ids, names);

  this.$("employeeField_lm2ckef9").setValue(employee);
});</code></pre>




    <h5 class="h5-parameters">Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Array.&lt;string></span>



            
            </td>

            

            

            <td class="description last">员工ID，接受单个ID字符串或者ID数组</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>name</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Array.&lt;string></span>



            
            </td>

            

            

            <td class="description last">员工姓名，接受单个字符串或者字符串数组</td>
        </tr>

    
    </tbody>
</table>
















<h5 class="h5-returns">Returns:</h5>

        
<div class="param-desc">
    员工字段数据
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">object</span>
|

<span class="param-type">Array.&lt;object></span>



    </dd>
</dl>

    



        
            

    

    <h4 class="name" id=".getFieldDataTypeById"><span class="type-signature type-signature-static">(static) </span>getFieldDataTypeById<span class="signature">(fieldId, multiple)</span><span class="type-signature"> &rarr; {string}</span></h4>

    




<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>根据字段唯一标识获取字段数据类型</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line41">line 41</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>











    <h5 class="h5-examples">Example</h5>
    
    <pre class="prettyprint"><code>getFieldDataTypeById("textField_lbd7nz2d"); // string
getFieldDataTypeById("employeeField_lm1cl4dk"); // object
getFieldDataTypeById("employeeField_lm1cl4dk", true); // array</code></pre>




    <h5 class="h5-parameters">Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>fieldId</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            
                <td class="default">
                
                </td>
            

            <td class="description last">字段唯一标识</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>multiple</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            

            
                <td class="default">
                
                    <code>false</code>
                
                </td>
            

            <td class="description last">字段是否能多选，仅对人员字段有效</td>
        </tr>

    
    </tbody>
</table>
















<h5 class="h5-returns">Returns:</h5>

        
<div class="param-desc">
    字段数据类型
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">string</span>



    </dd>
</dl>

    



        
            

    

    <h4 class="name" id=".getFieldTypeById"><span class="type-signature type-signature-static">(static) </span>getFieldTypeById<span class="signature">(fieldId)</span><span class="type-signature"> &rarr; {<a href="module-Field.html#~FieldType">module:Field~FieldType</a>}</span></h4>

    




<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>根据字段唯一标识获取字段类型</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line101">line 101</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>











    <h5 class="h5-examples">Example</h5>
    
    <pre class="prettyprint"><code>getFieldTypeId("textField_lbd7nz2d"); // text
getFieldTypeId("departmentSelectField_lbbyyrcy"); // departmentSelect</code></pre>




    <h5 class="h5-parameters">Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>fieldId</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">字段唯一标识</td>
        </tr>

    
    </tbody>
</table>
















<h5 class="h5-returns">Returns:</h5>

        
<div class="param-desc">
    字段类型
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-Field.html#~FieldType">module:Field~FieldType</a></span>



    </dd>
</dl>

    



        
            

    

    <h4 class="name" id=".mergeTo"><span class="type-signature type-signature-static">(static) </span>mergeTo<span class="signature">()</span><span class="type-signature"></span></h4>

    




<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>将主表上的一些同类型字段值合并到另外一个字段
目前仅支持合并附件类型字段</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line536">line 536</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>









    <h5 class="h5-this">This:</h5>
    <ul><li>CallbackThis.&lt;<a href="module-Field.html#~MergeToParams">module:Field~MergeToParams</a>></li></ul>






















        
            

    

    <h4 class="name" id=".syncTo"><span class="type-signature type-signature-static">(static) </span>syncTo<span class="signature">(changes)</span><span class="type-signature"></span></h4>

    




<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>同步组件字段的值到其他字段</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line508">line 508</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>









    <h5 class="h5-this">This:</h5>
    <ul><li>CallbackThis.&lt;<a href="module-Field.html#~SyncToParams">module:Field~SyncToParams</a>></li></ul>



    <h5 class="h5-examples">Example</h5>
    
    <pre class="prettyprint"><code>// 此函数不应该在代码中显式调用，而应该设置为组件的OnChange事件回调
// 并在回调参数中配置要与此组件值保持同步的字段标识:
// {
//   "target": "textField_xxxx"
// }
// 上面的回调参数表示将当前组件的值同步到textField_xxxx字段</code></pre>




    <h5 class="h5-parameters">Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>changes</code></td>
            

            <td class="type">
            
                
<span class="param-type">any</span>



            
            </td>

            

            

            <td class="description last">变更值</td>
        </tr>

    
    </tbody>
</table>



















        
    

    
        <h3 class="subsection-title">Type Definitions</h3>

        
                
<h4 class="name" id="~ArrayDiff">ArrayDiff</h4>





<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>数组差异对象</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line320">line 320</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>



    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>added</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;any></span>



            
            </td>

            

            

            <td class="description last">新增的元素</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>removed</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;any></span>



            
            </td>

            

            

            <td class="description last">删除的元素</td>
        </tr>

    
    </tbody>
</table>






<div class="description usertext">
    数组差异对象
</div>



    <h5 class="h5-types">Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Object</span>



        </li>
    </ul>






            
                
<h4 class="name" id="~AssociationFormInstance">AssociationFormInstance</h4>





<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>关联表单实例</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line219">line 219</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>



    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>instanceId</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">实例ID</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>title</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">显示的标题</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>subTitle</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">显示的副标题</td>
        </tr>

    
    </tbody>
</table>






<div class="description usertext">
    关联表单实例
</div>








            
                
<h4 class="name" id="~CallbackThis%3CT%3E">CallbackThis<T></h4>





<dl class="details">
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line485">line 485</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>



    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>params</code></td>
            

            <td class="type">
            
                
<span class="param-type">T</span>



            
            </td>

            

            

            <td class="description last">开发者手动配置的回调参数</td>
        </tr>

    
    </tbody>
</table>













            
                
<h4 class="name" id="~FieldType">FieldType</h4>





<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>字段类型</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line83">line 83</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description usertext">
    字段类型
</div>



    <h5 class="h5-types">Type:</h5>
    <ul>
        <li>
            
<span class="param-type">"text"</span>
|

<span class="param-type">"textarea"</span>
|

<span class="param-type">"number"</span>
|

<span class="param-type">"rate"</span>
|

<span class="param-type">"radio"</span>
|

<span class="param-type">"checkbox"</span>
|

<span class="param-type">"date"</span>
|

<span class="param-type">"cascadeDate"</span>
|

<span class="param-type">"employee"</span>
|

<span class="param-type">"departmentSelect"</span>
|

<span class="param-type">"select"</span>
|

<span class="param-type">"multiSelect"</span>
|

<span class="param-type">"cascadeSelect"</span>
|

<span class="param-type">"associationForm"</span>
|

<span class="param-type">"image"</span>
|

<span class="param-type">"attachment"</span>
|

<span class="param-type">"digitalSignature"</span>
|

<span class="param-type">"countrySelect"</span>
|

<span class="param-type">"address"</span>



        </li>
    </ul>






            
                
<h4 class="name" id="~FieldValueDiff">FieldValueDiff</h4>





<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>字段值差异对象</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line326">line 326</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>



    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>isEqual</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                

                
                </td>
            

            

            <td class="description last">两个值是否相等</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>new</code></td>
            

            <td class="type">
            
                
<span class="param-type">any</span>



            
            </td>

            
                <td class="attributes">
                

                
                </td>
            

            

            <td class="description last">新字段值</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>old</code></td>
            

            <td class="type">
            
                
<span class="param-type">any</span>



            
            </td>

            
                <td class="attributes">
                

                
                </td>
            

            

            <td class="description last">旧字段值</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>diff</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-Field.html#~ArrayDiff">module:Field~ArrayDiff</a></span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                
                </td>
            

            

            <td class="description last">数组类型字段值差异对象</td>
        </tr>

    
    </tbody>
</table>






<div class="description usertext">
    字段值差异对象
</div>



    <h5 class="h5-types">Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Object</span>



        </li>
    </ul>






            
                
<h4 class="name" id="~MergeToParams">MergeToParams</h4>





<dl class="details">
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line525">line 525</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>



    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>from</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Array.&lt;string></span>



            
            </td>

            

            

            <td class="description last">参与合并的字段标识</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>to</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last">目标字段标识，合并后的值赋值给此字段</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>type</code></td>
            

            <td class="type">
            
                
<span class="param-type">"attachment"</span>



            
            </td>

            

            

            <td class="description last">字段类型</td>
        </tr>

    
    </tbody>
</table>













            
                
<h4 class="name" id="~SyncToParams">SyncToParams</h4>





<dl class="details">
    
    <dt class="tag-description">Description:</dt>
    <dd class="tag-description"><ul class="dummy"><li>syncTo方法回调参数</li></ul></dd>
    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="field.js.html">field.js</a>, <a href="field.js.html#line490">line 490</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>



    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>target</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Array.&lt;string></span>



            
            </td>

            

            

            <td class="description last">要同步的字段标识</td>
        </tr>

    
    </tbody>
</table>






<div class="description usertext">
    syncTo方法回调参数
</div>



    <h5 class="h5-types">Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Object</span>



        </li>
    </ul>






            
    

    
</article>

</section>




    
    
</div>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Mar 19 2024 17:01:50 GMT+0800 (中国标准时间) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
<script src="scripts/polyfill.js"></script>
<script src="scripts/linenumber.js"></script>

<script src="scripts/search.js" defer></script>



</body>
</html>